package com.dhy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhy.beans.ClassscheduleClasssplit;
import com.dhy.mapper.AsysPartition1WeekMapper;
import com.dhy.mapper.ClassscheduleClasssplitMapper;
import com.dhy.policy.*;
import com.dhy.service.ClassscheduleClasssplitService;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 大忽悠
 * @since 2022-01-03
 */
@Service
public class ClassscheduleClasssplitServiceImpl extends ServiceImpl<ClassscheduleClasssplitMapper, ClassscheduleClasssplit> implements ClassscheduleClasssplitService
{
    @Resource
    private ClassscheduleClasssplitMapper classscheduleClasssplitMapper;
    @Resource
    private AsysPartition1WeekMapper asysPartition1WeekMapper;
    @Override
    public List<ClassscheduleClasssplit> getCourseByRequire(String week, String day, String section,String building) {
        EmptyClassRoom bySection=
                new SectionPolicy(
                new WeekDayPolicy(
                        new WeekPolicy(
                                new BuildingPolicy(null,classscheduleClasssplitMapper,building),
                                classscheduleClasssplitMapper,week),
                        classscheduleClasssplitMapper,day),
                classscheduleClasssplitMapper,section);
        return bySection.getEmptyClassRooms();
    }
}
